package com.xzp.controller;

import com.xzp.properties.GirlProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 演示Controller注解的使用
 * @ResponseBody + @Controller 等同于 @RestController 注解
 */
@Controller
@ResponseBody   //返回json对象
@RequestMapping("/test")
public class HelloController2 {

//    @Value("${girl.cupSize}")
//    private String cupSize;

    @Autowired
    private GirlProperties girlProperties;

    @GetMapping("/ControllerTest")
    private String hello(){
//        return "index";
        return girlProperties.getCupSize();
    }
}
